/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package simhya.matheval;

import simhya.matheval.function.FunctionDefinition;

/**
 *
 * @author Luca
 */
public abstract class FunctionNode extends ExpressionNode {
    protected FunctionDefinition function;
    
    
    public FunctionNode(FunctionDefinition function, int numberOfChildren) {
        super(numberOfChildren);
        this.function = function;
        random = function.isRandomFunction();
    }

    String getExpressionString(boolean fullNumberRepresentation) {
        String s = "";
        s += function.getName() + "(";
        for (int i=0;i<super.numberOfChildren;i++)
            s += (i>0 ? "," : "") + children[i].getExpressionString(false);
        s += ")";
        return s;
    }


    abstract void computeValue();
    abstract void computeValue(SymbolArray varReference);
    abstract void computeValue(int evaluationCode);
    abstract void computeValue(SymbolArray varReference, int evaluationCode);

}
